<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Pullword-永久免费的可自定义的中文在线分词API</title>
	<meta name="keywords" content="中文分词 在线分词 在线分词API 在线中文分词">
	<meta name="description" content="an online service of pulling chinese words from paragraphs, which is supported by Liang Bin(pennyliang.com) ">
	<link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.4/css/bootstrap.css">
	<link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap-glyphicons/1.0/css/bootstrap-glyphicons.css">
	<style>
		.textarea {
			border-bottom: 0;
			border-bottom-left-radius: 0;
			border-bottom-right-radius: 0;
		}
		.panel-footer {
			border-top:0;
			border-top-left-radius: 0;
			border-top-right-radius: 0;
		}
		 .page-footer {
			 padding-top: 50px;
			 padding-bottom: 50px;
			 margin-top: 100px;
			 color: #99979c;
			 text-align: center;
			 background-color: #2a2730;
		 }
		.alert {
			position: fixed;
			z-index: 1;
			width: 100%;
			display:none;

			-webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
			box-shadow: 0 5px 15px rgba(0,0,0,.5);
		}
		.navbar-inverse .navbar-brand {
			font-family: "Microsoft Yahei";
			color: #fff;
		}

		#mobile-submit {
			display: none;
		}
		@media (max-width: 992px) {
			#mobile-submit {
				display: block;
			}
			#submit {
				display: none;
			}
		}
	</style>
	<script type="text/javascript">
		var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
		document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F7c04459c43e769dc2852b78d1d5f922b' type='text/javascript'%3E%3C/script%3E"));
	</script>
	<script src="http://apps.bdimg.com/libs/html5shiv/3.7/html5shiv.min.js"></script>
	<script src="http://apps.bdimg.com/libs/respond.js/1.4.2/respond.js"></script>
	<script src="http://apps.bdimg.com/libs/jquery/1.9.1/jquery.js"></script>
	<script src="http://apps.bdimg.com/libs/bootstrap/3.3.4/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="js/jquery.autosize.min.js"></script>

	<script type="text/javascript">
		var autoResize = function() {  // 左右侧高度同步函数
			$('.right > textarea').height( $('.left > textarea').height());
		};


		var hideNotice = function() {
			$('#notice').hide(100);
		}

		var notice = function (msg) {
			$("#alert").show(100);
			$("#alert-message").text(msg);
			setTimeout(function () {
                $("#alert").hide();
            },3000)
        };

		$(function(){
			$('.left > textarea').focus(); // 页面加载完毕后将焦点交给左侧框
			$('#clear').click(function() {
				$('.left > textarea').val(""); // 清空左侧框
			});

			$('.left > textarea').autosize(); // 监听左侧内容改变自动更正高度
			$('.left > textarea').keydown(autoResize); // 触发高度同步
			$('.left > textarea').change(autoResize); // 触发高度同步

			$('#submit,#mobile-submit').click(pull);

			function pull() {// 处理分词请求
                if( $(".left > textarea").val() == "" ) {
                    notice("待分语句不能为空!");
                    return; // 如果左侧框为空就不处理并弹提示
                } // end if

                if( isNaN( $('#p1').val() ) || parseFloat($('#p1').val()) < 0 || parseFloat( $('#p1').val() ) > 1 ) {
                    notice("出词概率必填且必须是0-1之间!");
                    return; // 如果不是数字就不处理并弹提示
                } // end if

                $.ajax({ // 向服务器发出 POST 分词请求
                    type : "post",
                    url : "process.php",  // 这里是处理 POST 分词请求的目的地址，请务必按需要来改!!!
                    data : $(".left textarea, #p1, input[type=radio]:checked").serialize(),
                    // 序列化结果是：source=待分句子&param1=第一个数&param2=第二个，$_POST['source']、$_POST['param1']这样接收皆可
                    async : false,
                    success : function(data){ // 这里直接返回分完的结果纯文本data，如果是json的话请先解析再赋给右侧框
                        $('.right > textarea').val(data);
                    },
                    error : function(XMLHttpRequest, textStatus, errorThrown) {
                        notice("处理请求失败!");
                    }
                });
            }

			$('#good').click(function() { // 处理顶踩请求
				$.ajax({ // 向服务器发出 POST 顶踩请求
					type : "post",
					url : "evaluate.php",  // 这里是处理 POST 顶踩请求的目的地址，请务必按需要来改!!!
					data : $(".left textarea, .right textarea").serialize() + "&up=1", // "up=1"
					// 序列化结果：source=xx&result=xx&up=1  php: $_POST['source']  $_POST['result']  $_POST['up']
					async : false, 
					success : function(data){
						notice(data);
					},
					error : function(XMLHttpRequest, textStatus, errorThrown) {
						notice("处理请求失败!");
					}
				});
			});

			$('#bad').click(function() { // 处理顶踩请求
				$.ajax({ // 向服务器发出 POST 顶踩请求
					type : "post",
					url : "evaluate.php",  // 这里是处理 POST 顶踩请求的目的地址，请务必按需要来改!!!
					data : $(".left textarea, .right textarea").serialize() + "&down=1", // "down=1"
					// 序列化结果：source=xx&result=xx&down=1  php: $_POST['source']  $_POST['result']  $_POST['down']
					async : false, 
					success : function(data){
                        notice(data);
					},
					error : function(XMLHttpRequest, textStatus, errorThrown) {
						notice("处理请求失败!");
					}
				});
			});
		});
	</script>
</head>
<body>

<!-- 顶部代码开始 -->
<nav class="navbar navbar-inverse">
	<div class="container-fluid">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#sibling" aria-expanded="false">
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</button>
			<a class="navbar-brand" href="#">
				PullWord
			</a>
		</div>
		<div class="collapse navbar-collapse" id="sibling">
			<ul class="nav navbar-nav">
				<li><a href="http://www.pullwave.com">PullWave</a></li>
			</ul>
		</div>
	</div>
</nav>
<div class="alert alert-danger text-center in" id="alert">
	<p id="alert-message"></p>
</div>
<div class="page-header">
	<div class="container">
		<h1>永久免费的基于深度学习的中文在线抽词</h1>
	</div>
</div>
<!-- 顶部代码结束 -->
<!-- 核心部分开始 -->
<div class="container">
	<div class="row main pure-form">
		<div class="left col-md-5">
			<textarea class="textarea form-control" placeholder="请输入待分语句" name="source" required="" style="overflow: hidden; word-wrap: break-word; height: 434px;">李彦宏是马云最大威胁嘛？</textarea>
			<div class="panel panel-default">
				<div class="panel-footer">
					<div class="inleft">
						<input type="text" name="param1" id="p1" placeholder="参数1" value="0" class="form-control">
					</div>
					<div class="help-block">
						出词概率阈值(0-1之间的小数)，1表示只有100%有把握的词才出
					</div>
					<label for="op1" class="pure-radio">
						<input id="op1" type="radio" name="param2" value="0">
						正常模式
					</label>
					<label for="op2" class="pure-radio">
						<input id="op2" type="radio" name="param2" value="1" checked="">
						调试模式(显示概率)
					</label>
				</div>

			</div>
		</div>
		<div class="middle col-md-1">
			<button class="btn btn-primary" id="submit">分词</button>
		</div>
		<div class="right col-md-5">
			<textarea class="textarea form-control" name="result" style="height: 434px;"></textarea>
			<div class="panel panel-default">
				<div class="panel-footer">
					<button class="btn btn-primary" name="up" id="good"><i class="glyphicon glyphicon-thumbs-up"></i> 分得好</button>
					<button class="btn btn-default" name="down" id="bad"><i class="glyphicon glyphicon-thumbs-down"></i></button>
				</div>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-md-12">
			<button class="btn btn-primary btn-block" id="mobile-submit">分词</button>
		</div>
	</div>
</div>

<div class="page-header"></div>

<div class="container">
	<h3>使用API<small>本系统主机使用美团云</small></h3>
	<div class="panel panel-success">
		<div class="panel-body">
			访问：<b><a href="http://api.pullword.com/">api.pullword.com</a></b>
		</div>
	</div>
	<h3>接受赞助账号</h3>
	<div class="panel panel-success">
		<div class="panel-body">
			支付宝:    mgigabyte@gmail.com <br>
			PayPal:   pennynju@gmail.com  <br>
		</div>
	</div>
</div>


<!-- 核心部分结束 -->
<!-- 尾部代码开始 -->
<div class="container">
	<h3>后台云主机赞助名单</h3>
	<table class="table table-hover">
		<tr>
			<td>冯厂长</td>
			<td>2014-7月</td>
			<td>@Fenng</td>
		</tr>
		<tr>
			<td>程先生</td>
			<td>2014-8月</td>
			<td></td>
		</tr>
		<tr>
			<td>刘老师</td>
			<td>2014-9月</td>
			<td></td>
		</tr>
		<tr>
			<td>周鸿祎</td>
			<td>2014-10月</td>
			<td></td>
		</tr>
		<tr>
			<td>曾经的阿里码农</td>
			<td>2014-11月</td>
			<td></td>
		</tr>
		<tr>
			<td>梁斌</td>
			<td>2014-12月</td>
			<td></td>
		</tr>
		<tr>
			<td>qiuyuexp</td>
			<td>2015-1月</td>
			<td>@qiuyuexp</td>
		</tr>
		<tr>
			<td>刘老师</td>
			<td>2015-2月</td>
			<td>第二次</td>
		</tr>
		<tr>
			<td>董方_Vin</td>
			<td>2015-3月</td>
			<td>@董方_Vin</td>
		</tr>
		<tr>
			<td>搬运大数据的亨利</td>
			<td>2015-4月</td>
			<td>@搬运大数据的亨利</td>
		</tr>
		<tr>
			<td>英老师</td>
			<td>2015-5月</td>
			<td></td>
		</tr>
		<tr class="info">
			<td>美团云</td>
			<td>2015-6月到2017年-6月</td>
			<td>@美团云 @string_tang</td>
		</tr>
	</table>

	<hr>
	<div class="help-block">
		产品说明和开发历程,参见<a href="http://blog.sina.com.cn/s/blog_593af2a70102uw55.html">产品介绍</a> <br>
		本工作衍生产品，一每日收集新闻的站点lafnews，每天产生一个5万多条的新闻语料，免费提供下载 <a href="http://lafnews.com/" target="_blank">download</a><br>
		自然语言处理相关站点 <a href="http://www.52nlp.cn/">52nlp</a>
	</div>

	<hr>
	<a href="https://mos.meituan.com/">
		<img src="http://wx2.sinaimg.cn/large/e5c42c88ly1fdhk3nu8mnj20ku0280sz.jpg" class="img-responsive img-rounded center-block">
	</a>
</div>

	<!-- 尾部代码结束 -->
	<!-- 错误提示开始 -->
	<div id="notice">
	</div>
</body>
<footer class="page-footer">
	<div class="container">
		制作人：@肖世康<br>
		Copyright © @梁斌penny 服务提供商：北京八友科技有限公司<br>
		<a href="http://www.miitbeian.gov.cn/publish/query/indexFirst.action">京ICP备16014169号</a>
	</div>
</footer>
</html>